1. Field of the Invention
The invention relates to image processing method and apparatus for automatically correcting tilt of an inputted document image or the like.
The invention also relates to an image processing method and apparatus for editing an input image to an image suitable for extracting characters.
2. Related Background Art
Hitherto, when an input image in an image processing apparatus is rotated, a rotational angle is designated and the image is rotated by only the designated angle. Or, a straight line is drawn on a displayed image by using a mouse or the like and the image is rotated by only an angle such that the straight line is horizontal or vertical. In any one of the above methods, the rotational angle is inputted by the user.
In order to make the above processes unnecessary or to process an image by an apparatus without such a function, when the image is inputted, at a point in time when an original is set on a scanner, careful attention has to be paid so as not to bend a document of the original.
In the above conventional apparatus, however, when most of the portion of the input image is a document, it is desirable that a line is horizontal or vertical. In order to correct tilt, the operation by the user to instruct a rotational amount is always necessary. This is a drawback such that it becomes a burden for the operator.
According to the invention, an image processing method and apparatus which can eliminate tilt of an image at a high speed by shifting a strip of a width obtained from a tilt amount can be provided.
According to the invention, at least two partial image areas are determined in input image information and a tilt amount of the inputted image information is detected in accordance with projections which are detected from the two decided partial image areas, so that tilt of the input original can be accurately detected without intervention by the user.
According to the invention, by correcting tilt of the inputted image information in accordance with the detected tilt amount, image information whose tilt has been corrected can be obtained in accordance with tilt of the input image without intervention by the user.
According to the invention, by deciding the two partial image areas at a plurality of positions of the image information, a tilt amount can be more accurately detected.
According to the invention, by repeating the process to detect the tilt amounts at the decided plurality of positions, a tilt amount can be more accurately detected.
According to the invention, by detecting the tilt amount on the basis of a correlation of the projections which are detected from the two partial image areas, since the tilt amount is detected by the existing position of a line, so that a tilt amount can be more accurately detected.
According to the invention, one of the partial image areas is fixed, a correlation of the projections are detected while shifting he other partial image area, and a tilt angle is detected on the basis of the position of the partial image area in which the correlation is maximum, so that the tilt amount can be accurately detected.
According to the invention, by setting a shift of the partial image area into a predetermined range, the tilt amount can be efficiently detected.
According to the invention, when it is judged that an amount of a projection which is obtained from the partial image is insufficient, by interrupting a process to obtain a tilt amount, an unnecessary process at a location which is unsuitable for detection of the tilt amount can be interrupted, so that the processes can be efficiently executed.
According to the invention, the maximum value and the minimum value of the correlation among the projections are obtained and when a difference between the maximum and minimum values is small, by interrupting a process to obtain a tilt amount, an unnecessary process at a location which is unsuitable for detection of the tilt amount can be interrupted, so that the processes can be efficiently executed.
According to the invention, by displaying the corrected image information on a display means, an image of a high quality in which the tilt was corrected can be confirmed on the display.
According to the invention, by printing the corrected image information by printing means, a recording medium on which an image of a high quality in which the tilt had been corrected was printed can be obtained.
According to the invention, by registering the corrected image information into an electronic file, an image of a high quality can be registered into the electronic file having an object to preserve the images.
According to the invention, by recognizing the corrected image information, an image of a high quality can be provided for a recognizing process which needs an image of a high quality in order to obtain a high recognition ratio.
According to the invention, as for the correction of the image mentioned above, a division width of the image is determined in accordance with the detected tilt amount, the image is divided into a plurality of small areas of the decided division width, and the image is corrected by forming images obtained by shifting each of the plurality of divided small areas, so that a correcting process of the image that is suitable for the tilt of the image can be executed.
According to the invention, as for the division to the small areas of the image, the image is divided into each of the horizontal and vertical directions, and as for the formation of the images, a shifting process is executed to the divided small areas in both of the horizontal and vertical directions, so that the image whose tilt was corrected at a higher quality can be formed.